#ifndef MODELCOLORPALETTE_H
#define MODELCOLORPALETTE_H

#include <QWidget>
#include <QPushButton>
#include <QVector3D>
#include <QColorDialog>

namespace Ui {
class ModelColorPalette;
}

enum ColorType_em
{
    RGB,
    HSV,
};

class ModelColorPalette : public QColorDialog
{
    Q_OBJECT

public:
    explicit ModelColorPalette(QWidget *parent = nullptr);
    ~ModelColorPalette();

public:
    void initUI();
    void openColorDialog();

protected:
    void accept() override {
        // 不调用父类的accept()，避免对话框关闭
        emit colorSelected(currentColor());
    }

signals:
    void colorConfirmed(const QVector3D& selected_color);

private:
    Ui::ModelColorPalette *ui;
};

#endif // MODELCOLORPALETTE_H
